1. Field of the Invention
The present invention relates to a memory card in which a nonvolatile semiconductor memory is mounted, and in particular, to a memory card in which a nonvolatile semiconductor memory having a predetermined erased block size is mounted, as well as a semiconductor device mounted in the card, and a method of controlling the semiconductor memory.
2. Description of the Related Art
A NAND flash memory is often employed as a nonvolatile memory mounted in a memory card. In the NAND flash memory, a specified number of memory cells are grouped into a unit called a page. Further, a specified number of pages are grouped into a unit called a block.
The configuration of the NAND flash memory does not allow data to be simply written in a cell in which data has already been written. Erasure must be carried out in order to write data again. Here, the erasure can be carried out only in blocks. Reads and writes are generally carried out in pages. In particular, for writes, data must be sequentially written starting with a leading page in a physical block.
For example, it is assumed that a controller in a NAND flash memory changes data in a certain area (for example, a page) in a first block in which data has already been written, in response to a write request made by a host apparatus that uses the NAND flash memory. In this case, the controller first searches for a second block from which data has already been erased. Then, the controller sequentially writes (copies), to the second block, data contained in the area from the leading page of the first block to a page immediately before the one to be changed. Subsequently, the controller writes the data from the page to be changed, in the second block. Finally, the controller copies, to the second block, data contained in the area from a page immediately after the one to be changed to the final page.
Jpn. Pat. Appln. KOKAI Publication No. 2002-133877 discloses a NAND EEPROM that enables fast block erasures.
However, with the conventional write method, if a write is executed on a leading page in one block and then on a final page in another block, the time interval between the two writes is longest. In such a case, if the specification of the memory card includes a temporal restriction, the restriction may not be met. As a result, the memory card may malfunction. The above document may involve a similar problem.
It is thus desired to accomplish operations that meet the temporal restriction on writes.